<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>需要被冻结的会员</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/style/admin.css" media="all">
<body layadmin-themealias="default" style="">
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item" style="height: 20px;line-height: 20px;">
                <div class="layui-inline" style="margin-right: 0px;">
                     <span class="layui-breadcrumb">
                        <a href="">首页/需要被冻结的会员</a>
                        </span>
                </div>
                <div class="layui-inline" style="right: 0px;position: absolute;">
                    <a class="layui-btn layui-btn-small" style="line-height:20px;margin-top:-6px;float:right" href="javascript:location.replace(location.href);" title="刷新">
                        &nbsp;<i class="layui-icon layui-icon-refresh-3" style="line-height:18px;left: 12px;top:12px;"></i>&nbsp;
                    </a>
                </div>
            </div>
        </div>
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline" style="margin-right: 0px;">
                    <label class="layui-form-label">ID</label>
                    <div class="layui-input-inline">
                        <input type="number" name="gameid"  placeholder="游戏ID/用户ID"  class="layui-input">
                    </div>
                    <div class="layui-input-inline">
                        <input type="number" placeholder="手机号" name="phonenum"  class="layui-input" >
                    </div>
                </div>
                <div class="layui-inline" style="margin-right: 0px;">
                    <button class="layui-btn layuiadmin-btn-admin" lay-submit="" lay-filter="LAY-user-back-search">
                        搜索
                    </button>
                </div>
            </div>
        </div>

        <div class="layui-card-body">
            <table class="layui-table" lay-filter="admin_table" id="admin_table"></table>

            <script type="text/html" id="table-nickname">
                {{# if(d.disablelogin ==0){ }}
                    <a  style="font-size: 28px; border: none;" lay-event="nofree" title="冻结">
                        <i class='layui-icon layui-icon-face-smile-b' style="color: #59a15c; font-size: 28px;"></i>
                    </a>
                {{# } else { }}
                <a  style="font-size: 28px; border: none;" lay-event="free" title="解冻">
                    <i class='layui-icon layui-icon-password' style="color: red; font-size: 28px;"></i>
                </a>
                {{# } }}

            </script>

        </div>
    </div>
</div>

<script src="__PUBLIC__/layuiadmin/layui/layui.js"></script>
<script>
    function openWin(gameid,url) {
        layer.open({
            type: 2,
            title: '信息详情',
            shadeClose: true,
            shade: 0.8,
            maxmin: true,
            area: ['90%', '90%'],
            content: '/member/'+url+'?gameid='+gameid //iframe的url
        });
    }
    layui.config({
        base: '__PUBLIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table'], function(){
        var $ = layui.$
            ,form = layui.form
            ,table = layui.table;

        $(".layuiadmin-btn-admin").on("click",function(){
            var gameid = $("input[name=gameid]").val();
            var phonenum = $("input[name=phonenum]").val();


            table.reload('admin_table',{
                page:{
                    curr:1
                }
                ,where:{gameid:gameid,phonenum:phonenum}
            });
        });


        table.render({
            elem: '#admin_table'
            ,url: '/Freeze/getone' //数据接口
            ,title: '游戏详情'
            ,loading:true
            ,page: true //开启分页
            ,cols: [[ //表头
                {field: 'disablelogin', title: '冻结状态', width:160,align:'center',toolbar: '#table-nickname'}
                ,{field: 'phonenum', align:'center', title: '手机号', width:200}
                ,{field: 'gameid', title: '游戏ID', width:160}
                ,{field: 'nickname', title: '会员昵称', width:200}
                ,{field: 'registertime', title: '注册时间'}

            ]]
            ,done:function (res) {

            }
        });


        //监听行工具事件
        table.on('tool(admin_table)', function(obj){
            var data = obj.data;
            var id = obj.data.gameid;
            //解冻
            if(obj.event === 'free'){
               // alert(1);
                layer.msg('正在发送解冻请求，请稍后。。', {icon: 16,shade:0.5,time:1000,end:function () {
                        $.ajax({
                            type:"GET",
                            datatype:"json",
                            url:'/Freeze/nofree?id='+ id+'&type=8',
                            success:function (data) {
                                console.log(data);
                                if(data['code'] == 0){
                                    layer.msg(data['msg'],{icon: 5});
                                }else{
                                    layer.msg('解冻操作成功',{icon: 1});
                                   // layui.table.reload("admin_table");
                                }

                            },
                            error:function () {
                                layer.msg("发错错误",{icon: 5})
                            }
                        });
                    }});
            }else if(obj.event === 'nofree'){ //冻结
                var str=prompt("备注","");
                if(str){
                    layer.msg('正在发送冻结请求，请稍后。。', {icon: 16,shade:0.5,time:1000,end:function () {
                            $.ajax({
                                type:"GET",
                                datatype:"json",
                                url:'/Member/disablelogin?id='+ id+'&content='+str,
                                success:function (data) {
                                    if(data['code'] == 0){
                                        layer.msg(data['msg'],{icon: 5});
                                    }else{
                                        layer.msg('操作成功',{icon: 1});
                                        layui.table.reload("admin_table");
                                    }

                                },
                                error:function () {
                                    layer.msg("发错错误",{icon: 5})
                                }
                            });
                        }});
                }

            }
        });

      /*  //监听行工具事件
        table.on('toolbar(admin_table)', function(obj){
            var data = obj.data;
            //console.log(obj)
            if(obj.event === 'recharge'){
                // var id = '';
                //  id = obj.data.gameid;
                layer.msg('正在加载，请稍后。。', {icon: 16,shade:0.5,time:1000,end:function () {
                        layer.open({
                            type: 2,
                            title: '查询冻结玩家',
                            shadeClose: true,
                            shade: 0.8,
                            maxmin: true,
                            area: ['1400px', '80%'],
                            content: '/freeze/searchOne?type=add' //iframe的url
                        });
                    }});


            } else if(obj.event === 'info'){
                // var id = '';
                // id = obj.data.gameid;
                layer.msg('正在加载，请稍后。。', {icon: 16,shade:0.5,time:1000,end:function () {
                        layer.open({
                            type: 2,
                            title: '冻结IP地址',
                            shadeClose: true,
                            shade: 0.8,
                            maxmin: true,
                            area: ['1400px', '80%'],
                            content: '/freeze/getip' //iframe的url
                        });
                    }});
            }
        });*/
    });
</script>
</body>
</html>
<!--
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>需要被冻结的会员</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="{$Think.const.RESOURCE}img/favicon.ico">
    <link href="{$Think.const.RESOURCE}css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/animate.css" rel="stylesheet">
    <link href="{$Think.const.RESOURCE}css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="{$Think.const.RESOURCE}css/font.css">
    <link rel="stylesheet" href="{$Think.const.RESOURCE}css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="{$Think.const.RESOURCE}lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="{$Think.const.RESOURCE}js/xadmin.js"></script>
    <script type="text/javascript" src="{$Think.const.RESOURCE}js/bootstrap-paginator.js"></script>
    

  </head>
  
  <body class="layui-anim layui-anim-up">
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页/需要被冻结的会员</a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:39px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" action="{:U('freeze/searchOne')}" method="post">
          <input type="number" name="gameid"  placeholder="游戏ID" value="{$con.gameid}"  class="layui-input">
          <input type="number" value="{$con.phonenum}" placeholder="想冻结会员的手机号" name="phonenum"  class="layui-input"  style="width:200px;">
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
      </div>
       <xblock>
        <span class="x-right" style="line-height:10px;font-size:15px;float:left;margin-bottom:10px;font-weight:bold">共有数据:{$count}条</span>
      </xblock>
      <table class="layui-table">
                <thead>
                    <tr>
                        <th>冻结状态</th>
                        <th ><span style="display: inline-block; min-width: 60px;">会员ID</span></th>
                        <th>会员昵称</th>
                        <th>游戏ID</th>
                        <th>手机号</th>
                        <th>注册时间</th>
                    </tr>
                </thead>
                <tbody>
                    <volist name="lists" id="vo">
                        <tr>
                                <td class="" style="width:12px">
                                       <if condition="$vo.disablelogin eq 0 ">
                                       <a onclick="openWin({$vo.accountid})"><i class="fa fa-unlock text-info" style="font-size: 42px;"></i></a>
                                       <else/><a href="{:U('freeze/free')}?accountid={$vo.accountid}&disablelogin={$vo.disablelogin}&&con_gameid={$con.gameid}&&con_phonenum={$con.phonenum}"><i class="fa fa-lock text-danger" style="font-size: 42px;"></i> </a>
                                       </if>
                                </td>
                                <td class="contact-type" style="border-left: 1px solid #DDDDDD">{$vo.accountid}</td>
                                <td class="contact-type" style="border-left: 1px solid #DDDDDD">{$vo.nickname}</td>
                                <td class="contact-type" style="border-left: 1px solid #DDDDDD">{$vo.gameid}</td>
                                <td class="contact-type" style="border-left: 1px solid #DDDDDD">{$vo.phonenum}</td>
                                <td class="contact-type" style="border-left: 1px solid #DDDDDD">{$vo['regtime']}</td>
                        </tr>
                    </volist >
                </tbody>
      </table>
     &lt;!&ndash;  <div class="page">
            <ul id="example"></ul> 
            <input type="hidden" id="currentPage" value="{$p}">
            <input type="hidden" id="totalPages" value="{$totalPages}">
      </div> &ndash;&gt;
    </div>
    <script>
        function openWinAdd(){
            layer.open({
              type: 2,
              title: '查询冻结玩家',
              shadeClose: true,
              shade: 0.8,
              maxmin: true,
              area: ['1400px', '80%'],
              content: '/freeze/searchOne?type=add' //iframe的url
            }); 
        }
          function openWin(accountid) {
              var str=prompt("备注","");
              if(str !=null)
              {
                str = str; 
                layer.open({
                    type: 2,
                    title: '冻结玩家',
                    shadeClose: true,
                    shade: 0.8,
                    maxmin: true,
                    area: ['1400px', '80%'],
                    content: '/freeze/nofree?id='+ accountid+'&content='+str         //转向网页的地址;
                  }); 



                  // str = str; 
                  // var url='{:U("freeze/nofree")}?id='+ accountid+'&content='+str;         //转向网页的地址;
                  // var name='disablelogins';                            //网页名称，可为空;
                  // var iWidth=1000;                          //弹出窗口的宽度;
                  // var iHeight=600;                         //弹出窗口的高度;
                  // //获得窗口的垂直位置
                  // var iTop = (window.screen.availHeight - 30 - iHeight) / 2;
                  // //获得窗口的水平位置
                  // var iLeft = (window.screen.availWidth - 10 - iWidth) / 2;
                  // window.open(url, name, 'height=' + iHeight + ',,innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes,titlebar=no');  
              } 
          }
        
    </script>
  </body>
</html>-->
